{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/gwf25/Desktop/Table 5.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 7 Dec 2015, 10:07:44

{com}. do "/Users/gwf25/Dropbox/research/religion/final code/Table 5.do"
{txt}
{com}. clear all
{txt}
{com}. set mem 50m
{txt}(51200k)

{com}. set more off
{txt}
{com}. 
. use "/Users/gwf25/Dropbox/research/religion/final code/religion_all.dta"
{txt}
{com}. 
. //  Begin definition of variables
. 
. ***Drop subjects who thought the experiment was about religion
. gen id = _n
{txt}
{com}. drop if id == 98 | id == 176 | id == 194 | id == 383
{txt}(4 observations deleted)

{com}. 
. ***Drop subjects who incorrectly completed the priming task. This includes subjects who leave more than half the responses blank. The following subjects
. ***all left at least questions #2-#7 blank in the sentence unscrambling task. 
. drop if id==7 | id==719 | id==740 | id==762 | id==940
{txt}(5 observations deleted)

{com}. 
. ***An error led to some subjects seeing both the control and religion salient sentence unscrambling tasks. Here, we drop those subjects.
. drop if prime_diff == 1
{txt}(2 observations deleted)

{com}. 
. ***"skipped" is a dummy variable for whether subjects skip the question that asks their religion. If they skip this question, we drop them from the sample 
. ***and if not, we assign a dummy variable to indicate the treatment group (religion salient or control) that subject belongs to.
. gen skipped=0
{txt}
{com}. replace skipped=1 if  s10q15==""
{txt}(21 real changes made)

{com}. gen treatR=.
{txt}(1033 missing values generated)

{com}. replace treatR=religion if skipped==0
{txt}(1012 real changes made)

{com}. drop if skipped==1
{txt}(21 observations deleted)

{com}. 
. ***Define religion
. gen relig=.
{txt}(1012 missing values generated)

{com}. 
. ***Note: 1 = protestant or other christian, 2 = catholic, 3 = jewish, 4 = agnostic/atheist
. replace relig=1 if (s10q15=="Christian - Other (please specify below)" | s10q15=="Christian - Protestant (please specify denomination below)")
{txt}(264 real changes made)

{com}. replace relig=2 if s10q15=="Christian - Catholic"
{txt}(199 real changes made)

{com}. replace relig=3 if s10q15=="Jewish (Orthodox/Reformed/etc.)" | s10q15=="Jewish (Orthodox/Reform/etc.)"
{txt}(95 real changes made)

{com}. replace relig=4 if (s10q15=="Agnostic" | s10q15=="Atheist")
{txt}(269 real changes made)

{com}. 
. ***Drop Mormon/Othodox Christians from the sample
. drop if s10q15sp == "Greek Orthodox"
{txt}(2 observations deleted)

{com}. drop if s10q15sp == "Russian Othrodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "greek orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Orthodox Christian"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthdox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "christian orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthodox Christian"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Russian orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Church of Jesus Christ of Latter Day Saints"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthodox"
{txt}(0 observations deleted)

{com}. 
. drop id
{txt}
{com}. // End of variables
. 
. 
. ***Create the divine punishment variable
. gen divinepunish = s10q18sp4
{txt}(179 missing values generated)

{com}. egen divinepunish_std1 = std(divinepunish) if relig == 1
{txt}(796 missing values generated)

{com}. egen divinepunish_std2 = std(divinepunish) if relig == 2
{txt}(838 missing values generated)

{com}. egen divinepunish_std3 = std(divinepunish) if relig == 3
{txt}(923 missing values generated)

{com}. egen divinepunish_std4 = std(divinepunish) if relig == 4
{txt}(775 missing values generated)

{com}. gen divinepunish_std1_R = divinepunish_std1 * treatR if relig == 1
{txt}(796 missing values generated)

{com}. gen divinepunish_std2_R = divinepunish_std2 * treatR if relig == 2
{txt}(838 missing values generated)

{com}. gen divinepunish_std3_R = divinepunish_std3 * treatR if relig == 3
{txt}(923 missing values generated)

{com}. gen divinepunish_std4_R = divinepunish_std4 * treatR if relig == 4
{txt}(775 missing values generated)

{com}. 
. ***Create the median religious service attendance variable
. gen religserv_freq = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq = 1 if s10q16 == "Never"
{txt}(315 real changes made)

{com}. replace religserv_freq = 2 if s10q16 == "Less than once a month"
{txt}(388 real changes made)

{com}. replace religserv_freq = 3 if s10q16 == "Once a month"
{txt}(62 real changes made)

{com}. replace religserv_freq = 4 if s10q16 == "A few times a month"
{txt}(92 real changes made)

{com}. replace religserv_freq = 5 if s10q16 == "Once a week"
{txt}(102 real changes made)

{com}. replace religserv_freq = 6 if s10q16 == "A few times a week"
{txt}(32 real changes made)

{com}. replace religserv_freq = 7 if s10q16 == "Once a day"
{txt}(5 real changes made)

{com}. replace religserv_freq = 8 if s10q16 == "More than once a day"
{txt}(4 real changes made)

{com}. 
. egen median1 = median(religserv_freq) if relig == 1
{txt}(748 missing values generated)

{com}. gen religserv_freq1_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq1_median = 1 if religserv_freq > median1
{txt}(116 real changes made)

{com}. replace religserv_freq1_median = 0 if religserv_freq <= median1
{txt}(886 real changes made)

{com}. 
. egen median2 = median(religserv_freq) if relig == 2
{txt}(803 missing values generated)

{com}. gen religserv_freq2_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq2_median = 1 if religserv_freq > median2
{txt}(93 real changes made)

{com}. replace religserv_freq2_median = 0 if religserv_freq <= median2
{txt}(909 real changes made)

{com}. 
. egen median3 = median(religserv_freq) if relig == 3
{txt}(907 missing values generated)

{com}. gen religserv_freq3_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq3_median = 1 if religserv_freq > median3
{txt}(16 real changes made)

{com}. replace religserv_freq3_median = 0 if religserv_freq <= median3
{txt}(986 real changes made)

{com}. 
. egen median4 = median(religserv_freq) if relig == 4
{txt}(733 missing values generated)

{com}. gen religserv_freq4_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq4_median = 1 if religserv_freq > median4
{txt}(77 real changes made)

{com}. replace religserv_freq4_median = 0 if religserv_freq <= median4
{txt}(925 real changes made)

{com}. 
. gen religserv_freq1_median_R = treatR * religserv_freq1_median if relig == 1
{txt}(748 missing values generated)

{com}. gen religserv_freq2_median_R = treatR * religserv_freq2_median if relig == 2
{txt}(803 missing values generated)

{com}. gen religserv_freq3_median_R = treatR * religserv_freq3_median if relig == 3
{txt}(907 missing values generated)

{com}. gen religserv_freq4_median_R = treatR * religserv_freq4_median if relig == 4
{txt}(733 missing values generated)

{com}. 
. *Jewish Gift-Exchange Reciprocity
. rename m wageoffer
{txt}
{com}. 
. ***Create the cost, cXXX, for providing a certain amount of effort at eXXX. A certain monetary cost is associated with each level of output. So, we have:
. ***[eXXX, cXXX] = [(1,$0.00),(2,$0.04),(3,$0.08),(4,$0.16),(5,$0.24),(6,$0.32),(7,$0.40),(8,$0.48),(9,$0.60),(10,$0.72)]
. gen c000 = .
{txt}(1002 missing values generated)

{com}. replace c000 = 0 if e000 == 1
{txt}(423 real changes made)

{com}. replace c000 = .04 if e000 == 2
{txt}(2 real changes made)

{com}. replace c000 = .08 if e000 == 3
{txt}(0 real changes made)

{com}. replace c000 = .16 if e000 == 4
{txt}(1 real change made)

{com}. replace c000 = .24 if e000 == 5
{txt}(0 real changes made)

{com}. replace c000 = .32 if e000 == 6
{txt}(0 real changes made)

{com}. replace c000 = .40 if e000 == 7
{txt}(0 real changes made)

{com}. replace c000 = .48 if e000 == 8
{txt}(0 real changes made)

{com}. replace c000 = .60 if e000 == 9
{txt}(0 real changes made)

{com}. replace c000 = .72 if e000 == 10
{txt}(1 real change made)

{com}. 
. gen c050 = .
{txt}(1002 missing values generated)

{com}. replace c050 = 0 if e050 == 1
{txt}(315 real changes made)

{com}. replace c050 = .04 if e050 == 2
{txt}(78 real changes made)

{com}. replace c050 = .08 if e050 == 3
{txt}(25 real changes made)

{com}. replace c050 = .16 if e050 == 4
{txt}(3 real changes made)

{com}. replace c050 = .24 if e050 == 5
{txt}(2 real changes made)

{com}. replace c050 = .32 if e050 == 6
{txt}(0 real changes made)

{com}. replace c050 = .40 if e050 == 7
{txt}(1 real change made)

{com}. replace c050 = .48 if e050 == 8
{txt}(0 real changes made)

{com}. replace c050 = .60 if e050 == 9
{txt}(2 real changes made)

{com}. replace c050 = .72 if e050 == 10
{txt}(1 real change made)

{com}. 
. gen c100 = .
{txt}(1002 missing values generated)

{com}. replace c100 = 0 if e100 == 1
{txt}(216 real changes made)

{com}. replace c100 = .04 if e100 == 2
{txt}(68 real changes made)

{com}. replace c100 = .08 if e100 == 3
{txt}(97 real changes made)

{com}. replace c100 = .16 if e100 == 4
{txt}(31 real changes made)

{com}. replace c100 = .24 if e100 == 5
{txt}(11 real changes made)

{com}. replace c100 = .32 if e100 == 6
{txt}(0 real changes made)

{com}. replace c100 = .40 if e100 == 7
{txt}(2 real changes made)

{com}. replace c100 = .48 if e100 == 8
{txt}(0 real changes made)

{com}. replace c100 = .60 if e100 == 9
{txt}(1 real change made)

{com}. replace c100 = .72 if e100 == 10
{txt}(1 real change made)

{com}. 
. gen c150 = .
{txt}(1002 missing values generated)

{com}. replace c150 = 0 if e150 == 1
{txt}(181 real changes made)

{com}. replace c150 = .04 if e150 == 2
{txt}(41 real changes made)

{com}. replace c150 = .08 if e150 == 3
{txt}(56 real changes made)

{com}. replace c150 = .16 if e150 == 4
{txt}(75 real changes made)

{com}. replace c150 = .24 if e150 == 5
{txt}(58 real changes made)

{com}. replace c150 = .32 if e150 == 6
{txt}(8 real changes made)

{com}. replace c150 = .40 if e150 == 7
{txt}(5 real changes made)

{com}. replace c150 = .48 if e150 == 8
{txt}(1 real change made)

{com}. replace c150 = .60 if e150 == 9
{txt}(1 real change made)

{com}. replace c150 = .72 if e150 == 10
{txt}(1 real change made)

{com}. 
. gen c200 = .
{txt}(1002 missing values generated)

{com}. replace c200 = 0 if e200 == 1
{txt}(168 real changes made)

{com}. replace c200 = .04 if e200 == 2
{txt}(25 real changes made)

{com}. replace c200 = .08 if e200 == 3
{txt}(31 real changes made)

{com}. replace c200 = .16 if e200 == 4
{txt}(42 real changes made)

{com}. replace c200 = .24 if e200 == 5
{txt}(82 real changes made)

{com}. replace c200 = .32 if e200 == 6
{txt}(32 real changes made)

{com}. replace c200 = .40 if e200 == 7
{txt}(20 real changes made)

{com}. replace c200 = .48 if e200 == 8
{txt}(22 real changes made)

{com}. replace c200 = .60 if e200 == 9
{txt}(3 real changes made)

{com}. replace c200 = .72 if e200 == 10
{txt}(2 real changes made)

{com}. 
. gen c250 = .
{txt}(1002 missing values generated)

{com}. replace c250 = 0 if e250 == 1
{txt}(166 real changes made)

{com}. replace c250 = .04 if e250 == 2
{txt}(17 real changes made)

{com}. replace c250 = .08 if e250 == 3
{txt}(28 real changes made)

{com}. replace c250 = .16 if e250 == 4
{txt}(18 real changes made)

{com}. replace c250 = .24 if e250 == 5
{txt}(53 real changes made)

{com}. replace c250 = .32 if e250 == 6
{txt}(65 real changes made)

{com}. replace c250 = .40 if e250 == 7
{txt}(33 real changes made)

{com}. replace c250 = .48 if e250 == 8
{txt}(14 real changes made)

{com}. replace c250 = .60 if e250 == 9
{txt}(6 real changes made)

{com}. replace c250 = .72 if e250 == 10
{txt}(27 real changes made)

{com}. 
. gen c300 = .
{txt}(1002 missing values generated)

{com}. replace c300 = 0 if e300 == 1
{txt}(159 real changes made)

{com}. replace c300 = .04 if e300 == 2
{txt}(14 real changes made)

{com}. replace c300 = .08 if e300 == 3
{txt}(15 real changes made)

{com}. replace c300 = .16 if e300 == 4
{txt}(26 real changes made)

{com}. replace c300 = .24 if e300 == 5
{txt}(27 real changes made)

{com}. replace c300 = .32 if e300 == 6
{txt}(45 real changes made)

{com}. replace c300 = .40 if e300 == 7
{txt}(51 real changes made)

{com}. replace c300 = .48 if e300 == 8
{txt}(39 real changes made)

{com}. replace c300 = .60 if e300 == 9
{txt}(11 real changes made)

{com}. replace c300 = .72 if e300 == 10
{txt}(40 real changes made)

{com}. 
. gen c350 = .
{txt}(1002 missing values generated)

{com}. replace c350 = 0 if e350 == 1
{txt}(160 real changes made)

{com}. replace c350 = .04 if e350 == 2
{txt}(11 real changes made)

{com}. replace c350 = .08 if e350 == 3
{txt}(15 real changes made)

{com}. replace c350 = .16 if e350 == 4
{txt}(17 real changes made)

{com}. replace c350 = .24 if e350 == 5
{txt}(36 real changes made)

{com}. replace c350 = .32 if e350 == 6
{txt}(16 real changes made)

{com}. replace c350 = .40 if e350 == 7
{txt}(34 real changes made)

{com}. replace c350 = .48 if e350 == 8
{txt}(54 real changes made)

{com}. replace c350 = .60 if e350 == 9
{txt}(37 real changes made)

{com}. replace c350 = .72 if e350 == 10
{txt}(47 real changes made)

{com}. 
. gen c400 = .
{txt}(1002 missing values generated)

{com}. replace c400 = 0 if e400 == 1
{txt}(231 real changes made)

{com}. replace c400 = .04 if e400 == 2
{txt}(7 real changes made)

{com}. replace c400 = .08 if e400 == 3
{txt}(8 real changes made)

{com}. replace c400 = .16 if e400 == 4
{txt}(9 real changes made)

{com}. replace c400 = .24 if e400 == 5
{txt}(22 real changes made)

{com}. replace c400 = .32 if e400 == 6
{txt}(11 real changes made)

{com}. replace c400 = .40 if e400 == 7
{txt}(15 real changes made)

{com}. replace c400 = .48 if e400 == 8
{txt}(27 real changes made)

{com}. replace c400 = .60 if e400 == 9
{txt}(31 real changes made)

{com}. replace c400 = .72 if e400 == 10
{txt}(66 real changes made)

{com}. 
. ***Drop the highest effort amount
. drop c400
{txt}
{com}. 
. ***In order to properly reshape the data, we must rename the effort and cost of effort at $0 and $0.50
. rename e000 e0
{txt}
{com}. rename e050 e50
{txt}
{com}. rename c000 c0
{txt}
{com}. rename c050 c50
{txt}
{com}. 
. ***Create the corresponding wages for each effort choice
. gen w0 = 0
{txt}
{com}. gen w50 = .5
{txt}
{com}. gen w100 = 1
{txt}
{com}. gen w150 = 1.5
{txt}
{com}. gen w200 = 2
{txt}
{com}. gen w250 = 2.5
{txt}
{com}. gen w300 = 3
{txt}
{com}. gen w350 = 3.5
{txt}
{com}. 
. ***Create the estimated regression parameter where beta=reciprocity
. gen beta=.
{txt}(1002 missing values generated)

{com}. 
. gen id = _n
{txt}
{com}. 
. ***Reshape the data so that we can regress cost of effort on all possible wages, by subject
. reshape long c, i(id) j(w)
{txt}(note: j = 0 50 100 150 200 250 300 350)

Data{col 36}wide{col 43}->{col 48}long
{hline 77}
Number of obs.                 {res}    1002   {txt}->{res}    8016
{txt}Number of variables            {res}     243   {txt}->{res}     237
{txt}j variable (8 values)                     ->   {res}w
{txt}xij variables:
                        {res}c0 c50 ... c350   {txt}->   {res}c
{txt}{hline 77}

{com}. 
. ***Loop through all subjects and regress the effort on wage by each subject and save values of regression
. ***Note that some subjects did not do this section so we exclude them here. Only subjects numbered 263 through 689 did the gift exchange task.
. quiet forvalues x = 263/689 {c -(}
{txt}
{com}. 
. ***Reshape the data to its original form
. reshape wide c, i(id) j(w)
{txt}(note: j = 0 50 100 150 200 250 300 350)

Data{col 36}long{col 43}->{col 48}wide
{hline 77}
Number of obs.                 {res}    8016   {txt}->{res}    1002
{txt}Number of variables            {res}     237   {txt}->{res}     243
{txt}j variable (8 values)                 {res}w   {txt}->   (dropped)
xij variables:
                                      {res}c   {txt}->   {res}c0 c50 ... c350
{txt}{hline 77}

{com}. 
. reg beta treatR divinepunish_std3_R divinepunish_std3 if relig == 3, r

{txt}Linear regression                                      Number of obs ={res}      40
                                                       {txt}F(  3,    36) ={res}    1.75
                                                       {txt}Prob > F      = {res} 0.1750
                                                       {txt}R-squared     = {res} 0.1220
                                                       {txt}Root MSE      = {res} .00086

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}        beta{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}treatR {c |}{col 14}{res}{space 2} .0005775{col 26}{space 2} .0002917{col 37}{space 1}    1.98{col 46}{space 3}0.055{col 54}{space 4}-.0000141{col 67}{space 3} .0011691
{txt}divinepu~3_R {c |}{col 14}{res}{space 2} .0001346{col 26}{space 2} .0003188{col 37}{space 1}    0.42{col 46}{space 3}0.675{col 54}{space 4} -.000512{col 67}{space 3} .0007812
{txt}divinepuni~3 {c |}{col 14}{res}{space 2}-.0000625{col 26}{space 2} .0001556{col 37}{space 1}   -0.40{col 46}{space 3}0.690{col 54}{space 4}-.0003782{col 67}{space 3} .0002531
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .0004619{col 26}{space 2} .0001579{col 37}{space 1}    2.93{col 46}{space 3}0.006{col 54}{space 4} .0001417{col 67}{space 3}  .000782
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. reg beta treatR religserv_freq3_median_R religserv_freq3_median if relig == 3, r

{txt}Linear regression                                      Number of obs ={res}      40
                                                       {txt}F(  3,    36) ={res}    6.22
                                                       {txt}Prob > F      = {res} 0.0016
                                                       {txt}R-squared     = {res} 0.3315
                                                       {txt}Root MSE      = {res} .00075

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}        beta{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}treatR {c |}{col 14}{res}{space 2} .0010402{col 26}{space 2} .0002953{col 37}{space 1}    3.52{col 46}{space 3}0.001{col 54}{space 4} .0004414{col 67}{space 3}  .001639
{txt}r~3_median_R {c |}{col 14}{res}{space 2}-.0016085{col 26}{space 2} .0007013{col 37}{space 1}   -2.29{col 46}{space 3}0.028{col 54}{space 4}-.0030307{col 67}{space 3}-.0001863
{txt}rel~3_median {c |}{col 14}{res}{space 2} .0003831{col 26}{space 2} .0006394{col 37}{space 1}    0.60{col 46}{space 3}0.553{col 54}{space 4}-.0009137{col 67}{space 3} .0016798
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .0004169{col 26}{space 2} .0001556{col 37}{space 1}    2.68{col 46}{space 3}0.011{col 54}{space 4} .0001013{col 67}{space 3} .0007325
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. *Atheist/Agnostic Risk Premium
. clear all
{txt}
{com}. set mem 50m
{txt}(51200k)

{com}. set more off
{txt}
{com}. 
. use "/Users/gwf25/Dropbox/research/religion/final code/religion_all.dta"
{txt}
{com}. 
. //  Begin definition of variables
. 
. ***Drop subjects who thought the experiment was about religion
. gen id = _n
{txt}
{com}. drop if id == 98 | id == 176 | id == 194 | id == 383
{txt}(4 observations deleted)

{com}. 
. ***Drop subjects who incorrectly completed the priming task. This includes subjects who leave more than half the responses blank. The following subjects
. ***all left at least questions #2-#7 blank in the sentence unscrambling task. 
. drop if id==7 | id==719 | id==740 | id==762 | id==940
{txt}(5 observations deleted)

{com}. 
. ***An error led to some subjects seeing both the control and religion salient sentence unscrambling tasks. Here, we drop those subjects.
. drop if prime_diff == 1
{txt}(2 observations deleted)

{com}. 
. ***"skipped" is a dummy variable for whether subjects skip the question that asks their religion. If they skip this question, we drop them from the sample 
. ***and if not, we assign a dummy variable to indicate the treatment group (religion salient or control) that subject belongs to.
. gen skipped=0
{txt}
{com}. replace skipped=1 if  s10q15==""
{txt}(21 real changes made)

{com}. gen treatR=.
{txt}(1033 missing values generated)

{com}. replace treatR=religion if skipped==0
{txt}(1012 real changes made)

{com}. drop if skipped==1
{txt}(21 observations deleted)

{com}. 
. ***Define religion
. gen relig=.
{txt}(1012 missing values generated)

{com}. 
. ***Note: 1 = protestant or other christian, 2 = catholic, 3 = jewish, 4 = agnostic/atheist
. replace relig=1 if (s10q15=="Christian - Other (please specify below)" | s10q15=="Christian - Protestant (please specify denomination below)")
{txt}(264 real changes made)

{com}. replace relig=2 if s10q15=="Christian - Catholic"
{txt}(199 real changes made)

{com}. replace relig=3 if s10q15=="Jewish (Orthodox/Reformed/etc.)" | s10q15=="Jewish (Orthodox/Reform/etc.)"
{txt}(95 real changes made)

{com}. replace relig=4 if (s10q15=="Agnostic" | s10q15=="Atheist")
{txt}(269 real changes made)

{com}. 
. ***Drop Mormon/Othodox Christians from the sample
. drop if s10q15sp == "Greek Orthodox"
{txt}(2 observations deleted)

{com}. drop if s10q15sp == "Russian Othrodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "greek orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Orthodox Christian"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthdox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "christian orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthodox Christian"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Russian orthodox"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Church of Jesus Christ of Latter Day Saints"
{txt}(1 observation deleted)

{com}. drop if s10q15sp == "Greek Orthodox"
{txt}(0 observations deleted)

{com}. 
. 
. // End of variables
. 
. 
. ***Create the divine punishment variable
. gen divinepunish = s10q18sp4
{txt}(179 missing values generated)

{com}. egen divinepunish_std1 = std(divinepunish) if relig == 1
{txt}(796 missing values generated)

{com}. egen divinepunish_std2 = std(divinepunish) if relig == 2
{txt}(838 missing values generated)

{com}. egen divinepunish_std3 = std(divinepunish) if relig == 3
{txt}(923 missing values generated)

{com}. egen divinepunish_std4 = std(divinepunish) if relig == 4
{txt}(775 missing values generated)

{com}. gen divinepunish_std1_R = divinepunish_std1 * treatR if relig == 1
{txt}(796 missing values generated)

{com}. gen divinepunish_std2_R = divinepunish_std2 * treatR if relig == 2
{txt}(838 missing values generated)

{com}. gen divinepunish_std3_R = divinepunish_std3 * treatR if relig == 3
{txt}(923 missing values generated)

{com}. gen divinepunish_std4_R = divinepunish_std4 * treatR if relig == 4
{txt}(775 missing values generated)

{com}. 
. ***Create the median religious service attendance variable
. gen religserv_freq = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq = 1 if s10q16 == "Never"
{txt}(315 real changes made)

{com}. replace religserv_freq = 2 if s10q16 == "Less than once a month"
{txt}(388 real changes made)

{com}. replace religserv_freq = 3 if s10q16 == "Once a month"
{txt}(62 real changes made)

{com}. replace religserv_freq = 4 if s10q16 == "A few times a month"
{txt}(92 real changes made)

{com}. replace religserv_freq = 5 if s10q16 == "Once a week"
{txt}(102 real changes made)

{com}. replace religserv_freq = 6 if s10q16 == "A few times a week"
{txt}(32 real changes made)

{com}. replace religserv_freq = 7 if s10q16 == "Once a day"
{txt}(5 real changes made)

{com}. replace religserv_freq = 8 if s10q16 == "More than once a day"
{txt}(4 real changes made)

{com}. 
. egen median1 = median(religserv_freq) if relig == 1
{txt}(748 missing values generated)

{com}. gen religserv_freq1_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq1_median = 1 if religserv_freq > median1
{txt}(116 real changes made)

{com}. replace religserv_freq1_median = 0 if religserv_freq <= median1
{txt}(886 real changes made)

{com}. 
. egen median2 = median(religserv_freq) if relig == 2
{txt}(803 missing values generated)

{com}. gen religserv_freq2_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq2_median = 1 if religserv_freq > median2
{txt}(93 real changes made)

{com}. replace religserv_freq2_median = 0 if religserv_freq <= median2
{txt}(909 real changes made)

{com}. 
. egen median3 = median(religserv_freq) if relig == 3
{txt}(907 missing values generated)

{com}. gen religserv_freq3_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq3_median = 1 if religserv_freq > median3
{txt}(16 real changes made)

{com}. replace religserv_freq3_median = 0 if religserv_freq <= median3
{txt}(986 real changes made)

{com}. 
. egen median4 = median(religserv_freq) if relig == 4
{txt}(733 missing values generated)

{com}. gen religserv_freq4_median = .
{txt}(1002 missing values generated)

{com}. replace religserv_freq4_median = 1 if religserv_freq > median4
{txt}(77 real changes made)

{com}. replace religserv_freq4_median = 0 if religserv_freq <= median4
{txt}(925 real changes made)

{com}. 
. gen religserv_freq1_median_R = treatR * religserv_freq1_median if relig == 1
{txt}(748 missing values generated)

{com}. gen religserv_freq2_median_R = treatR * religserv_freq2_median if relig == 2
{txt}(803 missing values generated)

{com}. gen religserv_freq3_median_R = treatR * religserv_freq3_median if relig == 3
{txt}(907 missing values generated)

{com}. gen religserv_freq4_median_R = treatR * religserv_freq4_median if relig == 4
{txt}(733 missing values generated)

{com}. 
. 
. ***Drop those subjects who don't take part in the risk preference section
. drop if s3q1 == .
{txt}(596 observations deleted)

{com}. 
. ***Generate upper limit for risk with small amounts
. gen risk1=.
{txt}(406 missing values generated)

{com}. replace risk1=(1.6*0.5-1) if s3q1==1
{txt}(37 real changes made)

{com}. gen risk2=.
{txt}(406 missing values generated)

{com}. replace risk2=(2*0.5-1) if s3q2==1
{txt}(111 real changes made)

{com}. gen risk3=.
{txt}(406 missing values generated)

{com}. replace risk3=(2.4*0.5-1) if s3q3==1
{txt}(244 real changes made)

{com}. gen risk4=.
{txt}(406 missing values generated)

{com}. replace risk4=(2.8*0.5-1) if s3q4==1
{txt}(342 real changes made)

{com}. gen risk5=.
{txt}(406 missing values generated)

{com}. replace risk5=(3.2*0.5-1) if s3q5==1
{txt}(377 real changes made)

{com}. gen risk6=.
{txt}(406 missing values generated)

{com}. replace risk6=(3.6*0.5-1) if s3q6==1
{txt}(390 real changes made)

{com}. 
. ***Choose the upper limit for the first time a subject chooses the risky asset with small amounts.
. gen reservationrisk1= min(risk1,risk2,risk3,risk4,risk5,risk6)
{txt}(11 missing values generated)

{com}. 
. ***Generate upper limit for risk with large amounts
. gen risk7=.
{txt}(406 missing values generated)

{com}. replace risk7=(160*0.5-100)/100 if s4q1==1
{txt}(19 real changes made)

{com}. gen risk8=.
{txt}(406 missing values generated)

{com}. replace risk8=(200*0.5-100)/100 if s4q2==1
{txt}(51 real changes made)

{com}. gen risk9=.
{txt}(406 missing values generated)

{com}. replace risk9=(240*0.5-100)/100 if s4q3==1
{txt}(137 real changes made)

{com}. gen risk10=.
{txt}(406 missing values generated)

{com}. replace risk10=(280*0.5-100)/100 if s4q4==1
{txt}(224 real changes made)

{com}. gen risk11=.
{txt}(406 missing values generated)

{com}. replace risk11=(320*0.5-100)/100 if s4q5==1
{txt}(283 real changes made)

{com}. gen risk12=.
{txt}(406 missing values generated)

{com}. replace risk12=(360*0.5-100)/100 if s4q6==1
{txt}(298 real changes made)

{com}. 
. ***Choose the upper limit for the first time a subject chooses the risky asset with large amounts.
. gen reservationrisk2= min(risk7,risk8,risk9,risk10,risk11,risk12)
{txt}(102 missing values generated)

{com}. 
. ***Create two entries per subject. One is for small amounts and the other is for large amounts. riskchoice indicates whether it is a small or large stake gamble. 
. reshape long reservationrisk, i(id) j(riskchoice)
{txt}(note: j = 1 2)

Data{col 36}wide{col 43}->{col 48}long
{hline 77}
Number of obs.                 {res}     406   {txt}->{res}     812
{txt}Number of variables            {res}     240   {txt}->{res}     240
{txt}j variable (2 values)                     ->   {res}riskchoice
{txt}xij variables:
      {res}reservationrisk1 reservationrisk2   {txt}->   {res}reservationrisk
{txt}{hline 77}

{com}. 
. ***largestake is a dummy where a 1 indicates risk choices with large amounts and a 0 indicates risk choices with small amounts.
. gen largestake=0
{txt}
{com}. replace largestake= 1 if riskchoice==2 
{txt}(406 real changes made)

{com}. 
. ***Recall reservationrisk indicates the upper limit. Rename this variable risku and create another variable, riskl, which will indicate the lower limit.
. rename reservationrisk risk
{txt}
{com}. gen riskl=.
{txt}(812 missing values generated)

{com}. gen risku=risk
{txt}(113 missing values generated)

{com}. 
. ***Fill in values for the lower limit.
. ***Note that even if someone always chose the safe option, they are assigned a missing value for the upper limit and the highest possible value we ask about for the lower limit. So they are properly taken care of.
. replace riskl=. if risk < -.2
{txt}(0 real changes made)

{com}. replace riskl=(1.6*0.5-1) if risk == 0
{txt}(108 real changes made)

{com}. replace riskl=(2*0.5-1) if risk > .1 & risk < .3
{txt}(225 real changes made)

{com}. replace riskl=(2.4*0.5-1) if risk > .3 & risk < .5
{txt}(187 real changes made)

{com}. replace riskl=(2.8*0.5-1) if risk > .5 & risk < .7
{txt}(97 real changes made)

{com}. replace riskl=(3.2*0.5-1) if risk > .7 & risk < .9
{txt}(26 real changes made)

{com}. replace riskl=(3.6*0.5-1) if risk == . & s4q1 ~= .
{txt}(113 real changes made)

{com}. 
. intreg riskl risku treatR divinepunish_std4_R divinepunish_std4 largestake if relig==4, cluster(id)

{txt}Fitting constant-only model:
{res}
{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-213.18919}  
Iteration 1:{space 3}log pseudolikelihood = {res:-211.30754}  
Iteration 2:{space 3}log pseudolikelihood = {res:-211.29508}  
Iteration 3:{space 3}log pseudolikelihood = {res:-211.29508}  
{res}
{txt}Fitting full model:
{res}
{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-202.39282}  
Iteration 1:{space 3}log pseudolikelihood = {res:-200.86148}  
Iteration 2:{space 3}log pseudolikelihood = {res:-200.85509}  
Iteration 3:{space 3}log pseudolikelihood = {res:-200.85509}  
{res}
{txt}Interval regression{col 51}Number of obs{col 67}= {res}       116
{txt}{col 51}Wald chi2({res}4{txt}){col 67}= {res}     35.50
{txt}Log pseudolikelihood = {res}-200.85509{txt}{col 51}Prob > chi2{col 67}= {res}    0.0000

{txt}{ralign 78:(Std. Err. adjusted for {res:58} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}treatR {c |}{col 14}{res}{space 2}-.1295756{col 26}{space 2} .0688774{col 37}{space 1}   -1.88{col 46}{space 3}0.060{col 54}{space 4}-.2645729{col 67}{space 3} .0054217
{txt}divinepu~4_R {c |}{col 14}{res}{space 2} .0551842{col 26}{space 2} .0615189{col 37}{space 1}    0.90{col 46}{space 3}0.370{col 54}{space 4}-.0653907{col 67}{space 3}  .175759
{txt}divinepuni~4 {c |}{col 14}{res}{space 2}-.0472572{col 26}{space 2} .0507505{col 37}{space 1}   -0.93{col 46}{space 3}0.352{col 54}{space 4}-.1467265{col 67}{space 3}  .052212
{txt}{space 2}largestake {c |}{col 14}{res}{space 2} .2289578{col 26}{space 2} .0431925{col 37}{space 1}    5.30{col 46}{space 3}0.000{col 54}{space 4} .1443022{col 67}{space 3} .3136135
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .2095196{col 26}{space 2} .0460639{col 37}{space 1}    4.55{col 46}{space 3}0.000{col 54}{space 4} .1192359{col 67}{space 3} .2998032
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}    /lnsigma{col 14}{c |}{res}{space 2}-1.220403{col 26}{space 2} .0942774{col 37}{space 1}  -12.94{col 46}{space 3}0.000{col 54}{space 4}-1.405183{col 67}{space 3}-1.035623
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}       sigma{col 14}{c |}{res}{space 2} .2951112{col 26}{space 2} .0278223{col 54}{space 4} .2453221{col 67}{space 3} .3550052
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

  Observation summary:{col 24}{res}        5{col 34}{txt} left-censored observations
{col 24}{res}        0{col 34}{txt}    uncensored observations
{col 24}{res}       12{col 34}{txt}right-censored observations
{col 24}{res}       99{col 34}{txt}      interval observations

{com}. intreg riskl risku treatR religserv_freq4_median_R religserv_freq4_median largestake if relig==4, cluster(id)

{txt}Fitting constant-only model:
{res}
{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-368.76763}  
Iteration 1:{space 3}log pseudolikelihood = {res:-364.20797}  
Iteration 2:{space 3}log pseudolikelihood = {res:-364.16362}  
Iteration 3:{space 3}log pseudolikelihood = {res:-364.16362}  
{res}
{txt}Fitting full model:
{res}
{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-348.95412}  
Iteration 1:{space 3}log pseudolikelihood = {res:-344.75942}  
Iteration 2:{space 3}log pseudolikelihood = {res:-344.72808}  
Iteration 3:{space 3}log pseudolikelihood = {res:-344.72807}  
{res}
{txt}Interval regression{col 51}Number of obs{col 67}= {res}       196
{txt}{col 51}Wald chi2({res}4{txt}){col 67}= {res}     48.68
{txt}Log pseudolikelihood = {res}-344.72807{txt}{col 51}Prob > chi2{col 67}= {res}    0.0000

{txt}{ralign 78:(Std. Err. adjusted for {res:98} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}treatR {c |}{col 14}{res}{space 2}-.0753849{col 26}{space 2} .0582428{col 37}{space 1}   -1.29{col 46}{space 3}0.196{col 54}{space 4}-.1895387{col 67}{space 3} .0387689
{txt}r~4_median_R {c |}{col 14}{res}{space 2}-.2280747{col 26}{space 2} .1231613{col 37}{space 1}   -1.85{col 46}{space 3}0.064{col 54}{space 4}-.4694665{col 67}{space 3} .0133171
{txt}rel~4_median {c |}{col 14}{res}{space 2} .1505247{col 26}{space 2} .0848519{col 37}{space 1}    1.77{col 46}{space 3}0.076{col 54}{space 4} -.015782{col 67}{space 3} .3168314
{txt}{space 2}largestake {c |}{col 14}{res}{space 2} .2641374{col 26}{space 2} .0419377{col 37}{space 1}    6.30{col 46}{space 3}0.000{col 54}{space 4} .1819409{col 67}{space 3} .3463338
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .1348638{col 26}{space 2} .0375514{col 37}{space 1}    3.59{col 46}{space 3}0.000{col 54}{space 4} .0612643{col 67}{space 3} .2084632
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}    /lnsigma{col 14}{c |}{res}{space 2}-1.157348{col 26}{space 2} .0681024{col 37}{space 1}  -16.99{col 46}{space 3}0.000{col 54}{space 4}-1.290827{col 67}{space 3} -1.02387
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}       sigma{col 14}{c |}{res}{space 2} .3143185{col 26}{space 2} .0214058{col 54}{space 4} .2750433{col 67}{space 3} .3592021
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

  Observation summary:{col 24}{res}       12{col 34}{txt} left-censored observations
{col 24}{res}        0{col 34}{txt}    uncensored observations
{col 24}{res}       22{col 34}{txt}right-censored observations
{col 24}{res}      162{col 34}{txt}      interval observations

{com}. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/gwf25/Desktop/Table 5.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 7 Dec 2015, 10:07:50
{txt}{.-}
{smcl}
{txt}{sf}{ul off}